Adding Custom Behavior With Tag Objects
A tag object is a special kind of object whose purpose is to allow any type of application-defined information to be attached to a QuickDraw GX object. An object such as a shape or transform can be "tagged" with data or code that provides extra information about it or allows you to alter its behavior in specific situations.You can, for example, attach identifying strings to objects with tags. As another example, you can alter the way an object is displayed on a particular imaging device (such as a PostScript device) by attaching a tag to it that contains imaging commands specific to that device.
A tag object is attached to its associated object by means of a tag list, a property that most QuickDraw GX objects have. A tag list is an array of references to the tag objects attached to an object. Objects can thus have more than one attached tag object.
Because tags are QuickDraw GX objects, they can be shared. Like other QuickDraw GX objects, tags are accessible from objects in accelerator memory, they can be unloaded to disk and reloaded automatically, and they can be flattened (see "External Storage of Objects: Flattening and Unflattening" on page 1-23). See the chapter "Tag Objects" in this book for more information.